

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'email-template-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="rounded_corners_small box_shadow section_form">
    <h2 class="email">Create Email Template</h2>
	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'subject'); ?>
		<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>150)); ?>
		<?php echo $form->error($model,'subject'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'from_name'); ?>
		<?php echo $form->textField($model,'from_name',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'from_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'from_email'); ?>
		<?php echo $form->textField($model,'from_email',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'from_email'); ?>
	</div>

	<div class="row textarea">
		<?php echo $form->labelEx($model,'text_body'); ?>
		<?php echo $form->textArea($model,'text_body',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'text_body'); ?>
	</div>

	<div class="row tinymce_wrap">
		<?php echo $form->labelEx($model,'html_body'); ?>
        <div class="tinymce">
		<?php $this->widget('application.extensions.tinymce.ETinyMce', 
			array(
				'name'=>'EmailTemplate[html_body]',
				'options' => array('height'=>'250px','theme_advanced_toolbar_location'=>'top', 
							'theme'=>'advanced'),
				'value'=>$model->html_body,
			)); ?>
        </div><!-- .tinymce -->
		<?php echo $form->error($model,'html_body'); ?>
	</div>
    
    </div><!-- .section_form -->

	<div class="clear"></div><br />

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>
    	<div class="clear"></div><br />
    <div class="link">
    <?php echo CHtml::link('Back to List',ApplicationConfig::getURL("admin", "emailTemplate", "index"),array()); ?>
    </div>
<?php $this->endWidget(); ?>

